package com.flower.rpc;

import com.flower.rpc.bean.User;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

@Path("users")
@Produces({ MediaType.APPLICATION_JSON })
public interface UserService {


     @GET
     @Path("get/{id}")
     public User get(@PathParam("id") Long id);

     @POST
     @Path("byjson")
     @Consumes({ MediaType.APPLICATION_JSON })
     public User byJson(User user);

     @POST
     @Path("byform")
     @Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
     public User byForm(@FormParam("id") Long id, @FormParam("username") String username);

     @GET
     @Path("byquery")
     public User byQuery(@QueryParam("username") String username, @QueryParam("password") String password);

}
